package com.qianfeng.controller;

import com.qianfeng.dto.Message;
import com.qianfeng.dto.Result;
import com.qianfeng.entity.Education;
import com.qianfeng.service.EducationService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
public class EducationController {
    @Autowired
    private EducationService educationService;
    @RequiresAuthentication //认证通过可访问
    @CrossOrigin
    @ResponseBody
    @RequestMapping(value = "/getEducationList")
    public Result getEducationList(){
        Result result = new Result();
        List<Education> eductionList = educationService.getEductionList();
        result.setObj(eductionList);
        result.setMessage(new Message());
        return result;
    }
}
